package com.moon.config;

import cn.dev33.satoken.stp.StpInterface;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author thy
 * @description：todo
 * @date 2024/9/14 10:42
 */
@Component
public class StpInterfaceImpl implements StpInterface {
    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        String currentLoginId = (String) loginId;
        if ("admin".equals(currentLoginId))
            return Collections.singletonList("*");
        return Arrays.asList("sys:hello", "sys:update", "sys:insert", "sys:add", "sys:del");
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return null;
    }
}
